package com.fisherman.bean;

import org.springframework.beans.factory.annotation.Value;

//实体
public class Person {

    //使用@Value赋值
    //1,基本数据
    //2.可以写${};取出配置文件的值（运行在环境变量里面的值）

    @Value("张三")
    private String name;
    @Value("#{22}")
    private Integer age;

    @Value("${person.nickName}")
    private String nickName;


    //get,set方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", nickName='" + nickName + '\'' +
                '}';
    }

    //有参构造器
    public Person() {
        this.name = name;
        this.age = age;
        this.nickName = nickName;
    }

    //无参构造器
    public Person(String fisherman, int i) {
        super();
    }
}
